<?php

	//获取用户密码	-get_password.php
	//create by L
	//http://42.121.57.193:7788/platform/get_password.php?phone=13011112222
	//返回 0|用户密码

	include_once "init.php";

	$phone = $_GET["phone"];

	if('' == $phone )
	{
		die("-1|手机号码不可以为空");
	}
	if (strlen($phone) != 11 || false==is_numeric($phone) || ord($phone)!=49)
	{
		die("-1|手机号码必须是11位数字，并且以1开头");
	}
	$con    = db_connect(DB_NAME);
	$res = mysql_query("SELECT password from user where phone='$phone'") or die("-1|查询数据库错误");
	$row = mysql_fetch_row($res);

	if (empty($row))
	{
		mysql_close($con);
		die("-1|该手机号码未注册");
	}
	mysql_close($con);
	$password 	= $row['0'];
	echo '0|$password';
?>